package com.sumainfor.wx.tenant.controller;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.wx.tenant.service.ZfeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 *由前端 直接调用
 *
 */
@RestController
@RequestMapping("/ZwxTenant")
public class ZwxTenantController {

    @Autowired
    private ZfeignService zfeignService;
    /**
     * 签约时根据手机号查询微信端的租客信息
     * @return
     */
    @GetMapping("/getTenantByTenPhone")
    public JsonResult getTenantByTenPhone(@RequestParam  Map<String,Object> params){
        JsonResult result=new JsonResult();
        Map<String,Object> map=zfeignService.getTenantByTenPhone(params);
        if(map!=null){
            result.put(map);
        }else{
            result.putFailed("服务器繁忙");
        }
        return result;
    }
}
